#include <my_header.h>

/* Usage: ./10_pthread_exit2_主动退出 */

void funTHreadDeep(){
    printf("this is deep funaction \n");
    // 次数调用退出线程, 依旧会导致该方法所在线程退出
    // 即使当前方法不是线程的入口函数
    pthread_exit(NULL);
    printf("this scene2 well not be print \n");
}
void *funThread(void *arg){
    funTHreadDeep();// 调用另一个方法
    printf("this scene1 well not be print \n");
    return NULL;
} 

int main()
{
    pthread_t threadId;
    int ret = pthread_create(&threadId, NULL, funThread, NULL);
    THREAD_ERROR_CHECK(ret, "pthread_create");
    sleep(20);
    return 0;
}       

